Skip to content

KTween

Inherits Instance

KTween animates ("tweens") an object's properties smoothly over time. Call Create with the target, an info table and a table of goal values; you get back a KTweenHandle you can :Play().

The info table supports: Time (seconds), Style (Linear, Sine, Quad, Cubic, Quart, Quint, Expo, Circ, Elastic, Back, Bounce, Spring), Direction (In, Out, InOut, OutIn), DelayTime, Reverses and RepeatCount.

Example usage:

local tween = KTween:Create(part, { Time = 1, Style = "Sine", Direction = "InOut" }, {
  Position = Vector3.new(0, 10, 0),
  Color = Color.new(1, 0, 0)
})

tween:Play()

tween.Finished:Connect(function()
  print("done")
end)

Static Class

This object is a static class. It can be accessed like this: KTween.

Additionally, it cannot be created in the creator menu or with Instance.New().

Not newable

This object cannot be created by scripts using Instance.New().

Methods

Create → KTweenHandle

Parameters

target [ Instance ]

info [ table ]

goals [ table ]

Creates a tween that moves the target's properties to the given goal values. Returns a KTweenHandle. Call :Play() on it to start.